
import { createRouter, createWebHistory } from 'vue-router'
import PersonalCenter from '@/components/PersonalCenter.vue'
import ClubOverview from "@/components/ClubOverview.vue";
import Login from "@/components/Login.vue";
import Home from "@/components/Home.vue";
import ClubDe from "@/components/ClubDe.vue";
import ActivityOverview from "@/components/ActivityOverview.vue";
import CreateClub from "@/components/CreateClub.vue";
import ClubManage from "@/components/ClubManage.vue";
import Approval1 from "@/components/Approval1.vue";
import Approval2 from "@/components/Approval2.vue";
import ActManage from '@/components/ActManage.vue';
import Statistics from '@/components/Statistics.vue'
import Notice from '@/components/Notice.vue';
import ACManage from '@/components/ACManage.vue';
import NoticeManage from '@/components/NoticeManage.vue';
import CreateAct from "@/components/CreateAct.vue";
import ASCEManage from '@/components/ASCEManage.vue'

const routes = [
    {path:"/",redirect:'/login'},
    {
        path: '/login', // 通常我们会使用更具描述性的路径名
        name: 'Login',
        component: Login,
        meta: { keepAlive: false }, // 添加 meta 属性
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/personalcenter',
        name: 'PersonalCenter',
        component: PersonalCenter,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/club', // 通常我们会使用更具描述性的路径名
        name: 'ClubOverview',
        component: ClubOverview,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/activity',
        name: 'ActivityOverview',
        component: ActivityOverview,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/clubdetails',
        name: 'ClubDe',
        component: ClubDe,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/createclub',
        name: 'CreateClub',
        component: CreateClub,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/clubManage',
        name: 'ClubManage',
        component: ClubManage,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/approval1',
        name: 'Approval1',
        component: Approval1,
        meta: { keepAlive: true }, // 添加 meta 属性
        },
    {
        path: '/approval2',
        name: 'Approval2',
        component: Approval2,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/ActManage',
        name: 'ActManage',
        component: ActManage,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/notice',
        name: 'notice',
        component: Notice,
        meta: { keepAlive: false }, // 添加 meta 属性
    },
    {
        path: '/statistics',
        name: 'statistics',
        component: Statistics,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/ACManage',
        name: 'ACManage',
        component: ACManage,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/noticemanage',
        name: 'noticemanage',
        component: NoticeManage,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
    {
        path: '/CreateAct',
        name: 'CreateAct',
        component: CreateAct,
        meta: { keepAlive: true }, // 添加 meta 属性
    },

    {
        path: '/ASCEManage',
        name: 'ASCEManage',
        component: ASCEManage,
        meta: { keepAlive: true }, // 添加 meta 属性
    },
]

const router = createRouter({
    routes:routes,
    history: createWebHistory(process.env.BASE_URL), // 或者使用 createMemoryHistory()
})

export default router
